package 贪心;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

/**
 * @ClassName _763划分字母区间
 * @Description TODO
 * @Author 昝亚杰
 * @Date 2021/12/27 19:50
 * Version 1.0
 **/
public class _763划分字母区间 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        char[] s = string.toCharArray();
        int[] edge = new int[123];
        int max = 0,last = -1;
        StringBuffer stringbuffer = new StringBuffer();
        for(int i = 0; i < s.length; i++){
            edge[s[i] - 0] = i;
        }
        for(int i = 0; i < s.length; i++){
            max = Math.max(max,edge[s[i] - 0]);
            if(max == i){
                if(stringbuffer.length() != 0){
                    stringbuffer.append(" ");
                    stringbuffer.append(i - last);
                }else{
                    stringbuffer.append(i - last);
                }
                last = i;
            }
        }
        System.out.println(stringbuffer);
    }
    public static List<Integer> partitionLabels(String s) {
        int[] edge = new int[123];
        int max = 0;
        int last = -1;
        LinkedList<Integer> result = new LinkedList<Integer>();
        for(int i = 0; i < s.length(); i++){
            edge[s.charAt(i) - 0] = i;
        }
        for(int i = 0; i < s.length(); i++){
            max = Math.max(max,edge[s.charAt(i)]);
            if(max == i){
                result.add(i - last);
                last = i;
            }
        }
        return result;

    }
}
